/////////////////////////////////////////////////////////////////////////////
// Name:        dgt_pluginmanagerdlg.cpp
// Purpose:     
// Author:      Aleksey Plotnikov & Alla Nabatova
// Modified by: 
// Created:     13/03/2008 18:52:29
// RCS-ID:      
// Copyright:   Diamant Software
// Licence:     
/////////////////////////////////////////////////////////////////////////////

#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "dgt_pluginmanagerdlg.h"
#endif

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

////@begin includes
#include "dgt_ComponentTab.h"
#include "dgt_StoreTab.h"
#include "dgt_SyntezTab.h"
#include "dgt_OutTab.h"
#include "dgt_alltab.h"
////@end includes

#include "dgt_pluginmanagerdlg.h"

////@begin XPM images
////@end XPM images
#include "Images/action_add.xpm"
#include "Images/action_remove.xpm"
#include "Images/search.xpm"
#include "Images/browse.xpm"


/*!
 * dgt_PluginManagerDlg type definition
 */

IMPLEMENT_CLASS( dgt_PluginManagerDlg, wxFrame )


/*!
 * dgt_PluginManagerDlg event table definition
 */

BEGIN_EVENT_TABLE( dgt_PluginManagerDlg, wxFrame )

////@begin dgt_PluginManagerDlg event table entries
    EVT_CLOSE( dgt_PluginManagerDlg::OnCloseWindow )

////@end dgt_PluginManagerDlg event table entries

END_EVENT_TABLE()


/*!
 * dgt_PluginManagerDlg constructors
 */

dgt_PluginManagerDlg::dgt_PluginManagerDlg()
{
    Init();
}

dgt_PluginManagerDlg::dgt_PluginManagerDlg( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
    Init();
    Create( parent, id, caption, pos, size, style );
}


/*!
 * dgt_PluginManagerDlg creator
 */

bool dgt_PluginManagerDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin dgt_PluginManagerDlg creation
    wxFrame::Create( parent, id, caption, pos, size, style );

    this->SetBackgroundColour(wxColour(223, 223, 223));
    CreateControls();
    Centre();
////@end dgt_PluginManagerDlg creation
    return true;
}


/*!
 * dgt_PluginManagerDlg destructor
 */

dgt_PluginManagerDlg::~dgt_PluginManagerDlg()
{
////@begin dgt_PluginManagerDlg destruction
////@end dgt_PluginManagerDlg destruction
}


/*!
 * Member initialisation
 */

void dgt_PluginManagerDlg::Init()
{
////@begin dgt_PluginManagerDlg member initialisation
    m_searchButton = NULL;
    m_Path = NULL;
    m_BrowseButton = NULL;
////@end dgt_PluginManagerDlg member initialisation
}


/*!
 * Control creation for dgt_PluginManagerDlg
 */

void dgt_PluginManagerDlg::CreateControls()
{    
////@begin dgt_PluginManagerDlg content construction
    dgt_PluginManagerDlg* itemFrame1 = this;

    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
    itemFrame1->SetSizer(itemBoxSizer2);

    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText4 = new wxStaticText( itemFrame1, wxID_STATIC, _("Filter"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticText4->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma")));
    itemBoxSizer3->Add(itemStaticText4, 0, wxGROW|wxALL, 5);

    dgtFilterCtrl* itemPanel5 = new dgtFilterCtrl( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
    itemBoxSizer3->Add(itemPanel5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_searchButton = new wxBitmapButton( itemFrame1, ID_SEARCHBUTTON, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
    itemBoxSizer3->Add(m_searchButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticLine* itemStaticLine7 = new wxStaticLine( itemFrame1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
    itemBoxSizer2->Add(itemStaticLine7, 0, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer8, 1, wxGROW|wxALL, 5);

    wxAuiNotebook* itemAuiNotebook9 = new wxAuiNotebook( itemFrame1, ID_AUINOTEBOOK1, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TAB_MOVE|wxAUI_NB_TAB_FIXED_WIDTH|wxAUI_NB_WINDOWLIST_BUTTON|wxNO_BORDER );

    dgt_ComponentTab* itemPanel10 = new dgt_ComponentTab( itemAuiNotebook9, ID_COMPTAB, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    itemPanel10->SetName(_T("Component"));
    itemAuiNotebook9->AddPage(itemPanel10, _("Component"), false);

    dgt_StoreTab* itemPanel15 = new dgt_StoreTab( itemAuiNotebook9, ID_STORETAB, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
    itemPanel15->SetHelpText(_("Store plugins"));
    if (ShowToolTips())
        itemPanel15->SetToolTip(_("Store plugins"));
    itemPanel15->SetName(_T("Store"));
    itemAuiNotebook9->AddPage(itemPanel15, _("Store"), false);

    dgt_SyntezTab* itemPanel20 = new dgt_SyntezTab( itemAuiNotebook9, ID_SYNTEZTAB, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
    itemPanel20->SetName(_T("Syntez"));
    itemAuiNotebook9->AddPage(itemPanel20, _("Syntez"), false);

    dgt_OutTab* itemPanel25 = new dgt_OutTab( itemAuiNotebook9, ID_OUTTAB, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    itemPanel25->SetName(_T("Out"));
    itemAuiNotebook9->AddPage(itemPanel25, _("Out"), false);

    dgt_AllTab* itemPanel30 = new dgt_AllTab( itemAuiNotebook9, ID_ALLTAB, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
    itemPanel30->SetName(_T("All"));
    itemAuiNotebook9->AddPage(itemPanel30, _("All"), false);

    itemBoxSizer8->Add(itemAuiNotebook9, 1, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer35 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer35, 0, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText36 = new wxStaticText( itemFrame1, wxID_STATIC, _("Folder"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticText36->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma")));
    itemBoxSizer35->Add(itemStaticText36, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_Path = new wxTextCtrl( itemFrame1, ID_PATHTEXT, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer35->Add(m_Path, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_BrowseButton = new wxBitmapButton( itemFrame1, ID_BITMAPBUTTON1, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxNO_BORDER );
    if (dgt_PluginManagerDlg::ShowToolTips())
        m_BrowseButton->SetToolTip(_("Change plugin folder"));
    itemBoxSizer35->Add(m_BrowseButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

////@end dgt_PluginManagerDlg content construction

	m_searchButton->SetBitmapLabel(wxBitmap(search_xpm));
	this->SetLabel(_T("Plugin manager"));
	m_BrowseButton->SetBitmapLabel(wxBitmap(browse_xpm));
	


}


/*!
 * Should we show tooltips?
 */

bool dgt_PluginManagerDlg::ShowToolTips()
{
    return true;
}

/*!
 * Get bitmap resources
 */

wxBitmap dgt_PluginManagerDlg::GetBitmapResource( const wxString& name )
{
    // Bitmap retrieval
////@begin dgt_PluginManagerDlg bitmap retrieval
    wxUnusedVar(name);
    return wxNullBitmap;
////@end dgt_PluginManagerDlg bitmap retrieval
}

/*!
 * Get icon resources
 */

wxIcon dgt_PluginManagerDlg::GetIconResource( const wxString& name )
{
    // Icon retrieval
////@begin dgt_PluginManagerDlg icon retrieval
    wxUnusedVar(name);
    return wxNullIcon;
////@end dgt_PluginManagerDlg icon retrieval
}






void dgt_PluginManagerDlg::OnCloseWindow( wxCloseEvent& event )
{
	this->MakeModal(false);
    event.Skip();

}

